/*
 * @# AlbumLike.java 2011-12-26 下午06:47:38
 * 
 * Copyright (C) 2010 - 2011 广州羿安信息科技有限公司
 * Guangzhou ianswer information technology co. ltd.
 * 
 * All rights reserved!
 */
package com.ianswer.px.album.entity;

import javax.validation.constraints.NotNull;

import com.ianswer.px.user.entity.UserBaseInfo;

/**
 * 相册喜爱.
 * 
 * @author alvin hwang
 */
public class AlbumLike {

	private Long id;
	@NotNull
	private Long userId;
	@NotNull
	private Long albumId;
	private Long createdAt;
	private int pageIndex;

	// -------- user ----------------
	private UserBaseInfo user;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getAlbumId() {
		return albumId;
	}

	public void setAlbumId(Long albumId) {
		this.albumId = albumId;
	}

	public Long getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Long createdAt) {
		this.createdAt = createdAt;
	}

	public int getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}

	public UserBaseInfo getUser() {
		return user == null ? UserBaseInfo.get(userId) : user;
	}

	public void setUser(UserBaseInfo user) {
		this.user = user;
	}
	
}
